// packageC/pages/package/gonzhuangronqiguanli/package_improve/add_improve/add_improve.js
const mybehavior = require("../../../../../../behaviors/requests")
Page({

    /**
     * 页面的初始数据
     */
    behaviors: [mybehavior],
    data: {
        fs_upload_url: "https://logisticsengineering.gree.com/container_manage_api/container_manage",
        baseUrl: "https://logisticsengineering.gree.com/container_manage_api/advise_manage",
        img_required: false,
        data_arr: {},
        task_row_data: {},
        options1: [],
        choose_img_btn_disabled: false,
        data_list: [],
        company: "",
        manager: "",
        material_type: "",
        material_code: "",
        material_name: "",
        problem_description: "",
        problem_files: [],
        advice: "",
        advice_files: [],
        workshop_line: "",
        meet_standard: "",
        activeNamesDetail: ['1'],
        activeNamesStep: ['1'],
        inspect_show: false,
        handle_show: false,
        show_date: false,
        steps: [],
        step_active: 0,
        preIMG: false,
        step_expected_date_flag: false,

        opration: {
            "建议提交": ["待单位管理员确定是否推进"],
            "待单位管理员确定是否推进": ["完结-单位管理员关闭", "符合标准，单位管理员确定推进，待工艺员确定是否推进", "不符合标准，单位管理员确定推进，待责任单位管理员确定是否组织整改"],
            "符合标准，单位管理员确定推进，待工艺员确定是否推进": ["完结-工艺员关闭", "工艺员转交给其他工艺员,待其他工艺员确定是否推进", "工艺员确定推进,待报完工"],
            "工艺员转交给其他工艺员,待其他工艺员确定是否推进": ["完结-工艺员关闭", "工艺员确定推进,待报完工", "工艺员转交给其他工艺员,待其他工艺员确定是否推进"],
            "工艺员确定推进,待报完工": ["工艺员未完工，直接关闭", "工艺员报完工"],
            "不符合标准，单位管理员确定推进，待责任单位管理员确定是否组织整改": ["完结-责任单位关闭", "责任单位管理员转交给指定人员处理，待指定人员确定是否组织整改", "责任单位管理员已组织整改"],
            "责任单位管理员转交给指定人员处理，待指定人员确定是否组织整改": ["完结-责任单位关闭", "责任单位管理员转交给指定人员处理，待指定人员确定是否组织整改", "责任单位管理员已组织整改"]
        },

        map: {
            "建议提交": ["提交"],
            "待单位管理员确定是否推进": ["驳回", "同意"],// 符合标准 - 同意：符合标准，单位管理员确定推进，待工艺员确定是否推进；不符合标准- 同意：不符合标准，单位管理员确定推进，待责任单位管理员确定是否组织整改
            "符合标准，单位管理员确定推进，待工艺员确定是否推进": ["驳回", "转至其他人处理", "同意"],
            "工艺员转交给其他工艺员,待其他工艺员确定是否推进": ["驳回", "同意", "转至其他人处理"],
            "工艺员确定推进,待报完工": ["未完成", "完成"],
            "不符合标准，单位管理员确定推进，待责任单位管理员确定是否组织整改": ["驳回", "转至其他人处理", "已组织整改"],
            "责任单位管理员转交给指定人员处理，待指定人员确定是否组织整改": ["驳回", "转至其他人处理", "已组织整改"]
        },
        btn_list: [],
        status_list: [],
        action_str: "",
        status: "",
        submitter: "",
        submitter_name: "",
        reason: "",
        files: [],
        recipient_id: "",
        recipient_name: "",
        expected_date: "",
        change_handle_show: false,
        options_recipient: [],
        options_recipient_id: [],
        popup_cnt_show: false,
        change_auth: true,
        step_detail_show: false,
        step_row_data: {},
        zz_show: false,
        popup_date_show: false,
        currentDate: new Date().getTime(),
        minHour: 10,
        maxHour: 20,
        currentChoose: "",
        minDate: new Date().getTime()



    },
    onActiveDetailChange(event) {
        this.setData({
            activeNamesDetail: event.detail,
        });
    },
    onActiveChangeStep(event) {
        this.setData({
            activeNamesStep: event.detail,
        });
    },
    // 点击记录步骤
    showStep(e) {
        console.log(e);
        console.log("1", this.data.steps[e.detail]);
        if (!this.data.step_expected_date_flag && this.data.steps[e.detail].row_data.expected_date) {

            this.data.steps[e.detail].row_data.expected_date = this.GMTToStr(this.data.steps[e.detail].row_data.expected_date)
            this.setData({

                step_expected_date_flag: true
            })
        }
        this.setData({
            step_detail_show: true,
            step_row_data: this.data.steps[e.detail].row_data,
        })



    },
    onStepClose() {
        this.setData({
            step_row_data: {},

            step_detail_show: false,
        })
    },
    // 获取物料类别数据信息
    getMaterialnDatas() {
        let url = this.data.baseUrl + "/query_material_type"
        let data = {
            company: wx.getStorageSync('company')
        }
        this.post(url, data).then(res => {
            console.log("获取物料类别数据信息", res.data)
            let arr = []
            for (let i in res.data) {
                arr.push(res.data[i].material_type)
            }
            if (res.code == 20000) {
                this.setData({
                    options1: arr,
                })
            } else {
                wx.showToast({
                    title: res.msg,
                    icon: 'none'
                })
            }
        }).catch(err => {
            console.log(err);
            // wx.showToast({
            //   title: err.msg,
            //   icon: 'none'
            // })
        })
    },
    // 勾选是否符合标准
    onChange(event) {

        this.setData({
            meet_standard: event.detail,
        });
        let self = this
        let opration_key = "opration.待单位管理员确定是否推进"

        if (event.detail == "no") {
            self.setData({
                [opration_key]: ["完结-单位管理员关闭", "不符合标准，单位管理员确定推进，待责任单位管理员确定是否组织整改"],
                status_list: ["完结-单位管理员关闭", "不符合标准，单位管理员确定推进，待责任单位管理员确定是否组织整改"],
            })
            wx.showModal({
                title: '是否进行监督举报',
                content: '',
                complete: (res) => {
                    if (res.cancel) {
                        self.setData({
                            meet_standard: event.detail,
                        })
                    }
                    if (res.confirm) {
                        wx.navigateTo({
                            url: '/pages/containers_inspection/containers_inspection',

                        })
                    }
                }
            })
        } else {
            self.setData({
                [opration_key]: ["完结-单位管理员关闭", "符合标准，单位管理员确定推进，待工艺员确定是否推进"],
                status_list: ["完结-单位管理员关闭", "符合标准，单位管理员确定推进，待工艺员确定是否推进"],
            })


        }
    },
    showDetail(e) {
        let row = e.currentTarget.dataset.row_data
        console.log(row);

        wx.navigateTo({
            url: '/packageB/pages/package/pfep/standard_query/supplier_modify_standard/supplier_modify_standard',
            success(res) {
                res.eventChannel.emit('acceptDataFromOpenerPage', row)

            }
        })
    },

    showDetail1(e) {
        let row = e.currentTarget.dataset.row_data
        console.log(row);

        wx.navigateTo({
            url: '/packageB/pages/package/pfep/standard_query/zzj_standard/zzj_standard',
            success(res) {
                res.eventChannel.emit('acceptDataFromOpenerPage', row)

            }
        })
    },
    // 获取--物料编码模板--数据
    getStandardDatas(e) {
        wx.showLoading({
            title: '处理中...',
        })
        let url = "https://logisticsengineering.gree.com/pfep2_api/standard_doc_store_manage/transfer_batch2material_num2"
        let data = {
            batch_num: e,
            use_in: this.data.company,
        }
        console.log("传过去的数据", data);
        this.post(url, data).then(res => {
            console.log("物料编码模板", res.data.results);

            if (res.code == 20000) {
                if (res.data.material_type != "自制件") {
                    if (res.data.str_type == "物料编码") {
                        this.setData({
                            material_code: res.data.raw_str,
                        })
                    } else if (res.data.str_type == "物料标识卡") {
                        this.setData({
                            material_code: res.data.raw_str,
                        })
                    } else if (res.data.str_type == "物料批次号") {
                        this.setData({
                            material_code: res.data.raw_str,
                        })
                    }
                    if (res.data.results.length == 0 && res.data.str_type != "" && res.data.material_num != "") {
                        wx.showToast({
                            title: '该物料编码无标准',
                            icon: 'none'
                        })
                    }
                    if (res.data.results.length == 0 && res.data.str_type == "物料批次号" && res.data.material_num == "") {
                        wx.showToast({
                            title: '该物料批次号无物料编码信息',
                            icon: 'none'
                        })
                    }
                    if (res.data.results.length == 0 && res.data.str_type == "物料标识卡" && res.data.material_num == "") {
                        wx.showToast({
                            title: '该物料标识卡无物料编码信息',
                            icon: 'none'
                        })
                    }
                    if (res.data.results.length == 0 && res.data.str_type == "" && res.data.material_num == "") {
                        wx.showToast({
                            title: '该编码不存在',
                            icon: 'none'
                        })
                    }

                    this.setData({
                        zz_show: false,
                        data_list: res.data.results,
                        material_code: res.data.material_num
                    })
                    this.getMaterialName()
                    if (res.data.results.length != 0) {
                        wx.hideLoading()

                    }
                } else {
                    this.setData({
                        zz_show: true,
                        data_list: res.data.results,
                        material_code: res.data.material_num

                    })

                }
                if (res.data.results.length != 0) {
                    wx.hideLoading()

                }
            } else {

                wx.showToast({
                    title: res.msg,
                    icon: 'error'
                })
            }
        }).catch(err => {
            console.log(err);
            wx.showToast({
                title: err.msg,
                icon: 'none'
            })
        })
    },
    // 按钮查询获取--物料编码模板--数据
    getStandardDatas1() {
        // wx.showLoading({
        //   title: '处理中...',
        // })
        let url = "https://logisticsengineering.gree.com/pfep2_api/standard_doc_store_manage/transfer_batch2material_num2"
        let data = {
            batch_num: this.data.material_code,
            use_in: this.data.company,
        }
        console.log("传过去的数据", data);
        this.post(url, data).then(res => {
            console.log("物料编码模板", res.data.results);

            if (res.code == 20000) {

                if (res.data.material_type != "自制件") {
                    if (res.data.str_type == "物料编码") {
                        this.setData({
                            material_code: res.data.raw_str,
                        })
                    } else if (res.data.str_type == "物料标识卡") {
                        this.setData({
                            material_code: res.data.raw_str,
                        })
                    } else if (res.data.str_type == "物料批次号") {
                        this.setData({
                            material_code: res.data.raw_str,
                        })
                    }
                    if (res.data.results.length == 0 && res.data.str_type != "" && res.data.material_num != "") {
                        wx.showToast({
                            title: '该物料编码无标准',
                            icon: 'none'
                        })
                    }
                    if (res.data.results.length == 0 && res.data.str_type == "物料批次号" && res.data.material_num == "") {
                        wx.showToast({
                            title: '该物料批次号无物料编码信息',
                            icon: 'none'
                        })
                    }
                    if (res.data.results.length == 0 && res.data.str_type == "物料标识卡" && res.data.material_num == "") {
                        wx.showToast({
                            title: '该物料标识卡无物料编码信息',
                            icon: 'none'
                        })
                    }
                    if (res.data.results.length == 0 && res.data.str_type == "" && res.data.material_num == "") {
                        wx.showToast({
                            title: '该编码不存在',
                            icon: 'none'
                        })
                    }

                    this.setData({
                        zz_show: false,
                        data_list: res.data.results,
                        material_code: res.data.material_num
                    })
                    if (res.data.results.length != 0) {
                        wx.hideLoading()

                    }
                } else {
                    this.setData({
                        zz_show: true,
                        data_list: res.data.results,
                        material_code: res.data.material_num

                    })
                    console.log("自制件", res.data);
                    if (res.data.results.length != 0) {
                        wx.hideLoading()

                    }
                }



            } else {
                wx.showToast({
                    title: res.msg,
                    icon: 'error'
                })
            }
        }).catch(err => {
            console.log(err);
            // wx.showToast({
            //   title: err.msg,
            //   icon: 'none'
            // })
        })
    },

    // 扫描
    scan1(e) {
        let key = e.currentTarget.dataset.key
        console.log(key);
        const self = this;
        wx.scanCode().then((res) => {
            const label_code = res.result;
            wx.showLoading({
                title: "loading"
            })
            console.log(label_code);
            setTimeout(function () {
                wx.hideLoading()
                self.setData({
                    [key]: label_code,
                })
                self.getStandardDatas(label_code)

            }, 500)

        }).catch(err => {
            console.log(err);
        });
    },
    // 下拉选择
    getPickerVlaue(e) {
        let key = e.target.id
        this.setData({
            [key]: e.detail

        })
    },
    // 上传照片
    getUploaderVlaue(e) {
        let key = e.target.id
        this.setData({
            [key]: e.detail
        })
    },
    // 处理弹出框
    handleBtn(e) {
        if (this.data.meet_standard == "") {
            wx.showToast({
                title: '请勾选包装是否符合标准！',
                icon: 'none'
            })
        } else {
            console.log(e);
            let index = e.target.dataset.key
            let key_str = e.target.dataset.key_str
            let status_str = this.data.status_list[index]
            console.log("当前状态", status_str);
            if (key_str == "转至其他人处理") {
                this.setData({
                    change_handle_show: true,
                    action_str: status_str
                })
            } else if (status_str == "工艺员确定推进,待报完工") {
                this.setData({
                    handle_show: true,
                    show_date: true,
                    action_str: status_str
                })
            } else {
                this.setData({
                    handle_show: true,
                    action_str: status_str
                })
            }
        }



        // if (status_str == "工艺员转交给其他工艺员,待其他工艺员确定是否推进" ) {
        //   this.setData({
        //     change_handle_show: true,
        //     action_str: status_str
        //   })
        // } else if (status_str == "工艺员确定推进,待报完工") {
        //   this.setData({
        //     handle_show: true,
        //     show_date: true,
        //     action_str: status_str
        //   })
        // } else {
        //   this.setData({
        //     handle_show: true,
        //     action_str: status_str
        //   })
        // }


    },
    // 时分的事件方法
    selectDateMinuteChange(e) {
        console.log(e);
        let now_time = this.gainDate()
        if (e.detail.value < now_time) {
            return wx.showToast({
                title: '需求时间要求大于当前时间',
                icon: 'none'
            })
        } else {
            this.setData({
                expected_date: e.detail.value
            })
        }

    },
    // 确定开始日期输入框
    onDateConfirm(e) {
        const currentChoose = this.formatDate1(new Date(e.detail))
        let now_time = this.gainDate()
        if (currentChoose < now_time) {
            return wx.showToast({
                title: '需求时间要求大于当前时间',
                icon: 'none'
            })
        } else {
            this.setData({
                popup_date_show: false,
                expected_date: currentChoose
            })
        }




    },
    // 开始日期输入框关闭
    onDateClose() {
        this.setData({
            popup_date_show: false,
        });
    },
    // 开始点击输入框显示选择日期
    onDateClick() {
        this.setData({
            popup_date_show: true,
        });
    },
    formatTimestamp(timestamp) {
        const date = new Date(timestamp);
        const year = date.getFullYear();
        const month = String(date.getMonth() + 1).padStart(2, '0');
        const day = String(date.getDate()).padStart(2, '0');
        const hours = String(date.getHours()).padStart(2, '0');
        const minutes = String(date.getMinutes()).padStart(2, '0');
        const seconds = String(date.getSeconds()).padStart(2, '0');
        let str = year + '-' + month + '-' + day + ' ' + hours + ':' + minutes + ':' + seconds

        return str;
    },
    // 处理弹出框
    onHandleClose() {
        this.setData({
            handle_show: false,
            show_date: false,
            expected_date: "",
            reason: "",
            files: []
        })
    },

    // 对接人下拉框展示
    onClickCntShow() {
        this.setData({
            popup_cnt_show: true,
        })
    },
    // 转给其他人处理
    handleChange() {

    },
    onCntClose() {
        this.setData({
            popup_cnt_show: false,
        })
    },
    onCntChange(e) {
        console.log(e);
        let recipient_id1 = this.data.options_recipient_id[e.detail.index]
        this.setData({
            recipient_name: e.detail.value,
            recipient_id: recipient_id1,
            popup_cnt_show: false,

        })
        console.log(this.data.recipient_id);
    },
    // 获取对接人列表
    getConnectUser() {

        let url = "https://logisticsengineering.gree.com/container_manage_api/advise_manage/query_contact_person"
        let data = {
            company: wx.getStorageSync('company'),
            // manager: wx.getStorageSync('department'),
            material_type: "",
        }
        this.post(url, data).then(res => {

            if (res.code == 20000) {
                console.log("获取对接人列表", res.data);

                this.setData({
                    options_recipient: res.data[1],
                    options_recipient_id: res.data[0],
                    preIMG: true

                })

            } else {
                wx.showToast({
                    title: res.msg,
                    icon: 'none'
                })
            }
        }).catch(err => {
            console.log(err);
            wx.showToast({
                title: err.msg,
                icon: 'none'
            })
        })
    },
    // 转给其他人提交弹框关闭
    onChangeHandleClose() {
        this.setData({
            reason: "",
            change_handle_show: false,
            recipient_name: "",
        })
    },
    // 转给其他人处理提交
    onChangeSubmit() {
        if (this.data.reason == "") {
            wx.showToast({
                title: '请填写说明！',
                icon: 'none'
            })
        } else if (this.data.recipient_name == "") {
            wx.showToast({
                title: '请填写对接人！',
                icon: 'none'
            })
        } else {

            let url = this.data.baseUrl + "/advice_update"
            let data = {
                key: this.data.task_row_data.task_id,
                status: this.data.status,
                company: this.data.data_arr.company,
                manager: this.data.data_arr.manager,
                material_type: this.data.material_type,
                meet_standard: this.data.meet_standard,
                action: this.data.action_str,
                reason: this.data.reason,
                submitter: this.data.submitter,
                submitter_name: this.data.submitter_name,
                files: this.data.files,
                recipient_id: this.data.recipient_id,
                expected_date: this.data.expected_date,

            }
            console.log(data);
            this.post(url, data).then(res => {

                if (res.code == 20000) {
                    wx.showToast({
                        title: res.msg,
                        icon: 'success'
                    })
                    setTimeout(function () {
                        wx.reLaunch({
                            url: '/packageB/pages/package/task_manager/task_manager',
                        })
                    }, 2000)
                } else {
                    wx.showToast({
                        title: res.msg,
                        icon: 'none'
                    })
                }
            }).catch(err => {
                console.log(err);
                wx.showToast({
                    title: err.msg,
                    icon: 'none'
                })
            })


        }


    },
    // 提交
    submit() {
        if (this.data.reason == "") {
            wx.showToast({
                title: '请填写说明!',
                icon: 'none'
            })
        } else {
            if (this.data.action_str == "工艺员确定推进,待报完工" && this.data.expected_date == "") {
                wx.showToast({
                    title: '请填写预计完成时间!',
                    icon: 'none'
                })
            } else {
                if (this.data.meet_standard == "") {
                    wx.showToast({
                        title: '请勾选包装是否符合标准!',
                        icon: 'none'
                    })
                } else {
                    let url = this.data.baseUrl + "/advice_update"
                    let data = {
                        key: this.data.task_row_data.task_id,
                        status: this.data.status,
                        company: this.data.data_arr.company,
                        manager: this.data.data_arr.manager,
                        material_type: this.data.material_type,
                        meet_standard: this.data.meet_standard,
                        action: this.data.action_str,
                        reason: this.data.reason,
                        submitter: this.data.submitter,
                        submitter_name: this.data.submitter_name,
                        files: this.data.files,
                        recipient_id: this.data.recipient_id,
                        expected_date: this.data.expected_date,

                    }
                    console.log(data);
                    this.post(url, data).then(res => {

                        if (res.code == 20000) {
                            wx.showToast({
                                title: res.msg,
                                icon: 'success'
                            })
                            setTimeout(function () {
                                wx.reLaunch({
                                    url: '/packageB/pages/package/task_manager/task_manager',
                                })
                            }, 2000)
                        } else {
                            wx.showToast({
                                title: res.msg,
                                icon: 'none'
                            })
                        }
                    }).catch(err => {
                        console.log(err);
                        wx.showToast({
                            title: err.msg,
                            icon: 'none'
                        })
                    })
                }
            }


        }


    },
    /**
     * 生命周期函数--监听页面加载
     */
    onLoad(options) {
        let self = this
        const eventChannel = this.getOpenerEventChannel()
        // 监听acceptDataFromOpenerPage事件，获取上一页面通过eventChannel传送到当前页面的数据
        eventChannel.on('toHandle', function (data) {
            console.log("传过来的数据", data)
            let opration_key = "opration.待单位管理员确定是否推进"
            if (data.task.meet_standard == "yes") {
                self.setData({
                    [opration_key]: ["完结-单位管理员关闭", "符合标准，单位管理员确定推进，待工艺员确定是否推进"],
                })
            } else if (data.task.meet_standard == "no") {
                self.setData({
                    [opration_key]: ["完结-单位管理员关闭", "不符合标准，单位管理员确定推进，待责任单位管理员确定是否组织整改"],
                })
            } else {
                self.setData({
                    [opration_key]: [],
                })
            }
            console.log("当前opration数据", self.data.opration);

            let btn_list = self.data.map[data.task.status]
            let status_list = self.data.opration[data.task.status]

            if (data.flag !== "done") {
                self.setData({
                    inspect_show: true,
                })
            }
            if (data.task.status == "待单位管理员确定是否推进") {
                self.setData({
                    change_auth: false,
                })
            }

            let steps_arr = []
            for (let i in data.task.live_record) {
                data.task.live_record[i].time = self.GMTToStr(data.task.live_record[i].time)
                let obj = {
                    text: data.task.live_record[i].involved_name + '  ' + data.task.live_record[i].time + ' ' + data.task.live_record[i].reason,
                    // desc: data.task.recorders[i].name + '  -  ' + data.task.recorders[i].reason,
                    row_data: data.task.live_record[i]

                }
                steps_arr.push(obj)
            }
            console.log(steps_arr);
            self.setData({
                task_row_data: data,
                task_id: data.task_id,
                business_content: data.business_content,
                creator_name: data.creator_name,
                lastProcessUser: data.lastProcessUser,
                lastProcessAction: data.lastProcessAction,
                data_arr: data.task,
                advice: data.task.advice,
                company: data.task.company,
                material_type: data.task.material_type,
                meet_standard: data.task.meet_standard,
                material_code: data.task.material_code,
                material_name: data.task.material_name,
                problem_description: data.task.problem_description,
                problem_files: data.task.problem_files,
                advice_files: data.task.advice_files,
                workshop_line: data.task.workshop_line,
                status: data.task.status,
                submitter: data.task.submitter,
                submitter_name: data.task.submitter_name,
                steps: steps_arr,
                step_active: steps_arr.length,
                btn_list: btn_list,
                status_list: status_list,



            })
            self.getStandardDatas1()


        })
        eventChannel.on('showDetail', function (data) {
            console.log("传过来的数据", data)
            let opration_key = "opration.待单位管理员确定是否推进"
            if (data.task.meet_standard == "yes") {
                self.setData({
                    [opration_key]: ["完结-单位管理员关闭", "符合标准，单位管理员确定推进，待工艺员确定是否推进"],
                })
            } else if (data.task.meet_standard == "no") {
                self.setData({
                    [opration_key]: ["完结-单位管理员关闭", "不符合标准，单位管理员确定推进，待责任单位管理员确定是否组织整改"],
                })
            } else {
                self.setData({
                    [opration_key]: [],
                })
            }
            console.log("当前opration数据", self.data.opration);

            let btn_list = self.data.map[data.task.status]
            let status_list = self.data.opration[data.task.status]

            if (data.flag !== "done") {
                self.setData({
                    inspect_show: true,
                })
            }
            if (data.task.status == "待单位管理员确定是否推进") {
                self.setData({
                    change_auth: false,
                })
            }

            let steps_arr = []
            for (let i in data.task.live_record) {
                data.task.live_record[i].time = self.GMTToStr(data.task.live_record[i].time)
                let obj = {
                    text: data.task.live_record[i].involved_name + '  ' + data.task.live_record[i].time + ' ' + data.task.live_record[i].reason,
                    // desc: data.task.recorders[i].name + '  -  ' + data.task.recorders[i].reason,
                    row_data: data.task.live_record[i]

                }
                steps_arr.push(obj)
            }
            console.log(steps_arr);
            self.setData({
                task_row_data: data,
                task_id: data.task_id,
                business_content: data.business_content,
                creator_name: data.creator_name,
                lastProcessUser: data.lastProcessUser,
                lastProcessAction: data.lastProcessAction,
                data_arr: data.task,
                advice: data.task.advice,
                company: data.task.company,
                material_type: data.task.material_type,
                meet_standard: data.task.meet_standard,
                material_code: data.task.material_code,
                material_name: data.task.material_name,
                problem_description: data.task.problem_description,
                problem_files: data.task.problem_files,
                advice_files: data.task.advice_files,
                workshop_line: data.task.workshop_line,
                status: data.task.status,
                submitter: data.task.submitter,
                submitter_name: data.task.submitter_name,
                steps: steps_arr,
                step_active: steps_arr.length,
                btn_list: btn_list,
                status_list: status_list,



            })
            self.getStandardDatas1()


        })
    },

    /**
     * 生命周期函数--监听页面初次渲染完成
     */
    onReady() {

    },

    /**
     * 生命周期函数--监听页面显示
     */
    onShow() {
        // this.setData({
        //   company: wx.getStorageSync('company'),
        //   manager: wx.getStorageSync('department'),
        // })
        if (this.data.preIMG == false) {
            this.getConnectUser()
            this.getMaterialnDatas()
        }

    },

    /**
     * 生命周期函数--监听页面隐藏
     */
    onHide() {

    },

    /**
     * 生命周期函数--监听页面卸载
     */
    onUnload() {

    },

    /**
     * 页面相关事件处理函数--监听用户下拉动作
     */
    onPullDownRefresh() {

    },

    /**
     * 页面上拉触底事件的处理函数
     */
    onReachBottom() {

    },

    /**
     * 用户点击右上角分享
     */
    onShareAppMessage() {

    }
})